package com.ciwong.epaper.modules.me.util;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.support.v4.app.Fragment;

import com.ciwong.epaper.R;
import com.ciwong.epaper.modules.bookstore.ui.DuiBaActivity;
import com.ciwong.epaper.modules.epaper.bean.Answer;
import com.ciwong.epaper.modules.epaper.ui.TeacherRemarkActivity;
import com.ciwong.epaper.modules.me.bean.Clazz;
import com.ciwong.epaper.modules.me.ui.AboutActivity;
import com.ciwong.epaper.modules.me.ui.AboutUsActivity;
import com.ciwong.epaper.modules.me.ui.AgreementActivity;
import com.ciwong.epaper.modules.me.ui.AgreementCancelActivity;
import com.ciwong.epaper.modules.me.ui.BindPhoneActivity;
import com.ciwong.epaper.modules.me.ui.BookTagActivity;
import com.ciwong.epaper.modules.me.ui.ChooseSchoolActivity;
import com.ciwong.epaper.modules.me.ui.ClassListActivity;
import com.ciwong.epaper.modules.me.ui.CommonH5Activity;
import com.ciwong.epaper.modules.me.ui.DubVideoDetailActivity;
import com.ciwong.epaper.modules.me.ui.FavoritesListActivity;
import com.ciwong.epaper.modules.me.ui.FindH5Activity;
import com.ciwong.epaper.modules.me.ui.GroupingStudentActivity;
import com.ciwong.epaper.modules.me.ui.IssueRespActivity;
import com.ciwong.epaper.modules.me.ui.KeFuActivity;
import com.ciwong.epaper.modules.me.ui.MembersActivity;
import com.ciwong.epaper.modules.me.ui.ModifyMyPhoneActivity;
import com.ciwong.epaper.modules.me.ui.ModifyPasswordActivity;
import com.ciwong.epaper.modules.me.ui.MyInfoActivity;
import com.ciwong.epaper.modules.me.ui.MyServicesActivity;
import com.ciwong.epaper.modules.me.ui.OnlineServiceActivity;
import com.ciwong.epaper.modules.me.ui.PointRuleActivity;
import com.ciwong.epaper.modules.me.ui.ReadTipColorActivity;
import com.ciwong.epaper.modules.me.ui.ResetPasswordActivity;
import com.ciwong.epaper.modules.me.ui.ResourceCenterH5Activity;
import com.ciwong.epaper.modules.me.ui.ResourceCenterInnerH5Activity;
import com.ciwong.epaper.modules.me.ui.SendParentBuyActivity;
import com.ciwong.epaper.modules.me.ui.ServicesActivity;
import com.ciwong.epaper.modules.me.ui.UpdateClassNameActivity;
import com.ciwong.epaper.modules.me.ui.UpdateUserNameActivity;
import com.ciwong.epaper.modules.me.ui.WrittenOffAccountActivity;
import com.ciwong.epaper.modules.me.ui.clazz.ChangeClassActivity;
import com.ciwong.epaper.modules.me.ui.clazz.ClassDetailActivity;
import com.ciwong.epaper.modules.me.ui.clazz.ClassMemberActivity;
import com.ciwong.epaper.modules.msg.bean.WorkContent;
import com.ciwong.epaper.modules.pad.contentprovider.LoginToken;
import com.ciwong.epaper.ui.FirstAgreementActivity;
import com.ciwong.epaper.ui.MainActivity;
import com.ciwong.epaper.ui.NewLoginActivity;
import com.ciwong.epaper.ui.SplashActivity;
import com.ciwong.epaper.util.IntentFlag;
import com.ciwong.epaper.util.IntentValue;
import com.ciwong.libs.utils.CWLog;
import com.ciwong.mobilelib.ui.BrowserActivity;
import com.ciwong.mobilelib.utils.BaseActivityManager;
import com.ciwong.mobilelib.utils.BaseJumpManager;

/**
 * 我 跳转管理类
 *
 * @author bin
 * @version ciwong v.1.0 2015/7/23 19:34
 * @since ciwong v.1.0
 */
public class MeJumpManager extends BaseJumpManager {

    /**
     * 跳转到加入班级界面
     *
     * @param goBackId
     * @param context
     * @param jumpType {@link IntentValue.JumpToJoinClassType}
     */
    public static void jumpToJoinClassActivity(int goBackId, Activity context,
                                               int jumpType, int requestCode) {
//        Intent intent = getBaseIntent(goBackId, context,
//                JoinClassActivity.class);
        Intent intent = getBaseIntent(goBackId, context,
                ChangeClassActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, jumpType);

        context.startActivityForResult(intent, requestCode);

    }

    /**
     * 跳转到选择学校界面
     *
     * @param goBackId    启动activity
     * @param context     将要打开的activity
     * @param type        跳转类型
     * @param requestCode 返回码
     */
    public static void jumpToChooseSchool(int goBackId, Activity context,
                                          int type, int requestCode) {
        Intent intent = new Intent(context,
                ChooseSchoolActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, type);
        intent.putExtra(INTENT_FLAG_SOURCE, true);
        context.startActivityForResult(intent, requestCode);
    }


    /**
     * 跳转到意见反馈
     *
     * @param goBackId 启动activity
     * @param context
     */
    public static void jumpToIssueRespActivity(int goBackId, Activity context) {
        Intent intent = getBaseIntent(goBackId, context,
                IssueRespActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转到标签书籍 页面
     *
     * @param goBackId 启动activity
     * @param context
     */
    public static void jumpToBookTagActivity(int goBackId, int bookmarkId, String bookMarkTitle, Activity context) {
        Intent intent = getBaseIntent(goBackId, context, BookTagActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_BOOKMARK, bookmarkId);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, bookMarkTitle);
        context.startActivity(intent);
    }

    /**
     * 跳转服务列表界面/微商城
     *
     * @param goBackId    返回按钮的文字id
     * @param act         启动activity
     * @param requestCode 请求码
     */
    public static void jumpServices(int goBackId, Activity act, int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, ServicesActivity.class);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转服务列表界面
     *
     * @param goBackId    返回按钮的文字id
     * @param act         启动activity
     * @param fragment    Fragment对象
     * @param requestCode 请求码
     */
    public static void jumpServices(int goBackId, Activity act,
                                    Fragment fragment, int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, ServicesActivity.class);
        fragment.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到我的服务详情列表界面
     *
     * @param goBackId    返回按钮的文字id
     * @param act         启动activity
     * @param requestCode 请求码
     */
    public static void jumpToMyServices(int goBackId, Activity act,
                                        int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, MyServicesActivity.class);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 积分规则
     *
     * @param goBackId
     * @param act
     */
    public static void jumpToPiontRuleH5Activity(int goBackId, Activity act/*,String url, String title*/) {

        Intent intent = getBaseIntent(goBackId, act, PointRuleActivity.class);
        act.startActivity(intent);

    }

    public static void jumpToAboutUs(Activity act, int goBack) {
        Intent intent = getBaseIntent(goBack, act, AboutUsActivity.class);
        act.startActivity(intent);
    }

    /**
     * 跳转至隐私协议保护声明
     */
    public static void jumpToAreementCancel(Activity act, int goBackId, String url,
                                            String titile) {
        Intent baseIntent = getBaseIntent(goBackId, act, AgreementCancelActivity.class);
        baseIntent.putExtra(IntentFlag.INTENT_FLAG_AGREEMENT_CANCEL_URL, url);
        baseIntent.putExtra(IntentFlag.INTENT_FLAG_TITLE, titile);
        act.startActivity(baseIntent);

    }

    /**
     * 跳转客服
     *
     * @param context
     * @param goBack
     */
    public static void jumpToKeFu(Activity context, int goBack) {
        Intent intent = getBaseIntent(goBack, context, KeFuActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转通知家长购买
     *
     * @param context
     * @param goBack
     */
    public static void jumpSendParentBuyActivity(Activity context, int goBack) {
        Intent it = getBaseIntent(goBack, context, SendParentBuyActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到跟读提示文字颜色界面
     *
     * @param context
     * @param goBack
     */
    public static void jumpToReadTipColor(Activity context, int goBack) {
        Intent it = getBaseIntent(goBack, context, ReadTipColorActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到视频界面
     *
     * @param goBackId
     * @param context
     * @param
     */
    public static void jumpToDubVideoDetailActivity(int requesttCode, int goBackId, Activity context, String workId, WorkContent workContent, String classId, int contentId) {
        Intent intent = getBaseIntent(goBackId, context,
                DubVideoDetailActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, workContent);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_ID, workId);
        intent.putExtra(IntentFlag.INTENT_FLAG_CONTENTID, contentId);
        intent.putExtra(IntentFlag.INTENT_FLAG_CLASS_ID, classId);
        context.startActivityForResult(intent, requesttCode);
    }

    /**
     * 跳转到登录
     *
     * @param context
     */
    public static void jumpToLogin(Activity context) {
        Intent it = getBaseIntent(0, context, NewLoginActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到登录
     *
     * @param context
     */
    public static void jumpToSplash(Activity context) {
        Intent it = getBaseIntent(0, context, SplashActivity.class);
        it.putExtra(LoginToken.ACTION_KEY_RELOGIN, true);
        context.startActivity(it);
    }

    /**
     * 跳转到关于我们
     *
     * @param context
     */
    public static void jumpToAbout(Activity context) {
        Intent it = getBaseIntent(R.string.go_back, context,
                AboutActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到在线客服浏览器
     *
     * @param act
     * @param goBackId
     * @param url
     * @param title
     */
    public static void jumpToOnlineService(Activity act, int goBackId,
                                           String url, String title) {
        Intent intent = getBaseIntent(goBackId, act,
                OnlineServiceActivity.class);
//        intent.putExtra(OnlineServiceActivity.IntentString.INTENT_STRING_URL, url);
//        intent.putExtra(OnlineServiceActivity.IntentString.INTENT_STRING_TITLE, title);
        intent.putExtra(IntentFlag.INTENT_FLAG_URL, url);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
        act.startActivity(intent);
    }

    /**
     * 跳转到登陆页面
     */
    public static void jumpToLogin2(Activity act, int goBackId, String mobile, String psw, int loginType) {
        Intent intent = getBaseIntent(goBackId, act, NewLoginActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_STR, mobile);
        intent.putExtra(IntentFlag.INTENT_FLAG_PSW, psw);
        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, loginType);
        act.startActivityForResult(intent, NewLoginActivity.FOR_LOGIN);
    }


    /**
     * 跳转到个人信息界面
     *
     * @param act
     * @param goBackId
     * @param requestCode
     */
    public static void jumpToMyInfo(Fragment act, int goBackId, int requestCode) {
        Intent intent = getBaseIntent(goBackId, act.getActivity(), MyInfoActivity.class);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到更换手机号界面
     *
     * @param act
     * @param goBackId
     * @param
     */
    public static void jumpToModifyPhone(Activity act, int goBackId, String phoneNumber) {
        Intent intent = new Intent(act, ModifyMyPhoneActivity.class);
        intent.putExtra(INTENT_FLAG_SOURCE, true);
        intent.putExtra(IntentFlag.INTENT_FLAG_STR, phoneNumber);
        act.startActivity(intent);
    }

    /**
     * 跳转到重置密码页面
     *
     * @param activity
     * @param goBackId
     * @param phoneNumber
     * @param verity_code
     */

    public static void jumpResetPasswordActivity(Activity activity, int goBackId, String phoneNumber, String verity_code) {
        Intent intent = getBaseIntent(goBackId, activity, ResetPasswordActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_STR, phoneNumber);
        intent.putExtra(IntentFlag.INTENT_FLAG_SMS, verity_code);
        activity.startActivity(intent);


    }

    /**
     * 跳转到班级列表界面
     *
     * @param act
     * @param goBackId
     * @param requestCode
     */
    public static void jumpToClassList(Activity act, int goBackId, int jumpType,
                                       int requestCode, String phoneNum, Clazz clazz) {
        Intent intent = getBaseIntent(goBackId, act, ClassListActivity.class);

        if (null != clazz) {
            intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, clazz);
        }

        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, jumpType);
        if (null != phoneNum) {
            intent.putExtra(IntentFlag.INTENT_FLAG_STR, phoneNum);
        }
        act.startActivityForResult(intent, requestCode);

    }

    /**
     * 跳转到班级详情界面
     *
     * @param act
     * @param goBackId
     */
    public static void jumpToClassDetail(Activity act, int goBackId, Clazz clazz
            , int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, ClassDetailActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, clazz);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到班级成员变量
     *
     * @param act
     * @param goBackId
     */
    public static void jumpToClassMember(Activity act, int goBackId, Clazz clazz
    ) {
        Intent intent = getBaseIntent(goBackId, act, ClassMemberActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, clazz);
        act.startActivity(intent);
    }

    /**
     * 跳转到更换班级界面
     *
     * @param act
     * @param goBackId
     */
    public static void jumpToChangeClass(Activity act, int goBackId, int jumpType, int requestCode, Clazz clazz) {
        Intent intent = getBaseIntent(goBackId, act, ChangeClassActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, clazz);
        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, jumpType);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到老师点评界面
     *
     * @param act
     * @param goBackId
     * @param answer
     */
    public static void jumpToRemarkActivity(Activity act, int goBackId,
                                            Answer answer) {
        Intent intent = getBaseIntent(goBackId, act,
                TeacherRemarkActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, answer);
        act.startActivity(intent);
    }

    /**
     * 跳转到修改名界面
     *
     * @param act
     * @param goBackId
     * @param requestCode
     */
    public static void jumpToUpdateUserNameActivity(Activity act, int goBackId,
                                                    int requestCode) {
        Intent intent = getBaseIntent(goBackId, act,
                UpdateUserNameActivity.class);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到修改密码界面
     *
     * @param goBackId 返回按钮的文字id
     * @param activity 启动Activity
     */
    public static void jumpToModifyPassword(int goBackId, Activity activity) {
        Intent intent = getBaseIntent(goBackId, activity,
                ModifyPasswordActivity.class);
        activity.startActivity(intent);
    }


    public static void jumpToCallPhone(int goBackId, Activity act, String phone) {
        if (!act.isFinishing()) {
            try {
                Intent intent = new Intent(Intent.ACTION_DIAL);
                intent.putExtra(BaseJumpManager.INTENT_FLAG_SOURCE, true);
                intent.putExtra(GO_BACK_ID, goBackId);
                intent.setData(Uri.parse("tel:" + phone));
                act.startActivity(intent);
            } catch (ActivityNotFoundException e) {
                CWLog.e("MeJumpManager", "手机上没有安装拨号软件");
            }
        }
    }

    /**
     * 跳转绑定手机号页面
     *
     * @param goBackId    返回按钮
     * @param act         上下文
     * @param phonenumber
     * @param id          标志不同来源
     *                    1忘记密码   2.绑定手机号 3.注册
     */
    public static void jumpToBindPhoneActivity(int goBackId, Activity act, String phonenumber, String id) {
        if (!act.isFinishing()) {
            Intent intent = getBaseIntent(goBackId, act, BindPhoneActivity.class);
            intent.putExtra(IntentFlag.INTENT_FLAG_STR, phonenumber);
            intent.putExtra(IntentFlag.INTENT_FLAG_ID, id);
            act.startActivity(intent);

        }
    }

    /**
     * 跳转绑定手机号页面
     *
     * @param goBackId    返回按钮
     * @param act         上下文
     * @param phonenumber
     * @param id          标志不同来源
     *                    1忘记密码   2.绑定手机号 3.注册
     */
    public static void jumpToBindPhoneActivity(int goBackId, Activity act, String phonenumber, String id, int type, int requestcode) {
        if (!act.isFinishing()) {
            Intent intent = getBaseIntent(goBackId, act, BindPhoneActivity.class);
            intent.putExtra(IntentFlag.INTENT_FLAG_STR, phonenumber);
            intent.putExtra(IntentFlag.INTENT_FLAG_ID, id);
            intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, type);
            act.startActivityForResult(intent, requestcode);
        }
    }

    /**
     * 跳转到注销账号
     *
     * @param goBackId
     * @param context
     * @param url
     * @param title
     */
    public static void jumpWrittenOffActivity(int goBackId, Activity context, String url, String title) {
        Intent intent = getBaseIntent(goBackId, context, WrittenOffAccountActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_URL, url);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
        context.startActivity(intent);
    }

    /**
     * 跳转到隐私协议
     *
     * @param goBackId
     * @param context
     * @param url
     * @param title
     */
    public static void jumpAgreementActivity(int goBackId, Activity context, String url, String title, String action) {
        Intent intent = getBaseIntent(goBackId, context, AgreementActivity.class);
        intent.putExtra(BrowserActivity.IntentString.INTENT_STRING_URL, url);
        intent.putExtra(BrowserActivity.IntentString.INTENT_STRING_TITLE, title);
        intent.putExtra(IntentFlag.INTENT_FLAG_ACTION, action);
        context.startActivity(intent);
    }

    /**
     * 跳转到信息保护指引
     *
     * @param goBackId
     * @param context
     * @param url
     * @param title
     */
    public static void jumpFirstAgreementActivity(int goBackId, Activity context, String url, String title, String action) {
        Intent intent = getBaseIntent(goBackId, context, FirstAgreementActivity.class);
        intent.putExtra(BrowserActivity.IntentString.INTENT_STRING_URL, url);
        intent.putExtra(BrowserActivity.IntentString.INTENT_STRING_TITLE, title);
        intent.putExtra(IntentFlag.INTENT_FLAG_ACTION, action);
        context.startActivity(intent);
    }

    /**
     * 跳到MeFragment中的学习设置页面
     *
     * @param context
     * @param goBack
     * @param reqCode
     * @param type
     */
    public static void jumpToMainActivity(Activity context, int goBack, int reqCode, int type) {
        Intent it = getBaseIntent(goBack, context, MainActivity.class);
        it.putExtra(IntentFlag.INTENT_FLAG_SETTING_JUMP_SOURCE, type);
        context.startActivityForResult(it, reqCode);
    }

    /**
     * @param context
     * @param backId  R.string.go_back
     * @param title   标题
     */
    public static void jumpToResourseCenterH5Activity(Activity context,
                                                      int backId, String title) {
        Intent intent = getBaseIntent(backId, context,
                ResourceCenterH5Activity.class);
//        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, type);
//        intent.putExtra(, IntentFlag.INTENT_FLAG_URLurl);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
        context.startActivity(intent);
    }

    /**
     * @param context
     * @param backId  R.string.go_back
     * @param title   标题
     */
    public static void jumpToFindH5Activity(Activity context,
                                            int backId, String title) {
        Intent intent = getBaseIntent(backId, context,
                FindH5Activity.class);
//        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, type);
//        intent.putExtra(, IntentFlag.INTENT_FLAG_URLurl);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
        context.startActivity(intent);
    }

    /**
     * @param context
     * @param backId  R.string.go_back
     * @param title   标题
     */
    public static void jumpToCommonH5Activity(Activity context,
                                              int backId, String title, String url) {
        Intent intent = getBaseIntent(backId, context,
                CommonH5Activity.class);
//        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, type);
        intent.putExtra(IntentFlag.INTENT_FLAG_URL, url);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
        context.startActivity(intent);
    }

    /**
     * 资源中心的内部页面
     *
     * @param goBackId
     * @param act
     * @param url
     */

    public static void jumpToResourseCenterInnerH5Activity(int goBackId, Activity act, String url/*, String title*/) {

        Intent intent = getBaseIntent(goBackId, act, ResourceCenterInnerH5Activity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_URL, url);
        act.startActivity(intent);

    }

    private static boolean isContainsActivityInStack(Class clazz) {
        if (clazz != null) {
            return BaseActivityManager.getInstance().isContainsActivityInStack(clazz);
        }
        return false;
    }

    /**
     * 跳到兑吧h5页面
     *
     * @param act
     * @param goBackId
     * @param url
     */
    public static void jumpToDuiBaActivity(Activity act, int goBackId, String url) {

        Intent intent = getBaseIntent(goBackId, act, DuiBaActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_URL, url);
        act.startActivity(intent);
    }

    /**
     * 跳转至学生列表页面
     *
     * @param className   班级名
     * @param clientId
     * @param classId     班级id
     * @param isGrouping  是否分组
     * @param teamID      组id
     * @param teamName    组名
     * @param requestCode 跳转码
     * @param context
     */
    public static void jumpToMembersActivity(String className, String clientId, int classId, Boolean isGrouping, int teamID, String teamName, int requestCode, Activity context) {
        Intent intent = new Intent(context, MembersActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_CLASS_NAME, className);
        intent.putExtra(IntentFlag.INTENT_FLAG_CLIENT_ID, clientId);
        intent.putExtra(INTENT_FLAG_SOURCE, true);
        intent.putExtra(IntentFlag.INTENT_FLAG_CLASS_ID, classId);
        intent.putExtra(IntentFlag.INTENT_FLAG_BOOLEAN, isGrouping);
        intent.putExtra(IntentFlag.INTENT_FLAG_TEAM_ID, teamID);
        intent.putExtra(IntentFlag.INTENT_FLAG_TEAM_NAME, teamName);
        context.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转至分组页面
     *
     * @param classId    班级id
     * @param className  班级名
     * @param clientId
     * @param schoolName 学校名
     * @param gradeId    年级id
     * @param context
     */
    public static void jumpToGroupingStuActivity(int goBackId, int classId, String className, String clientId, String schoolName, int gradeId, Activity context) {
        Intent intent = getBaseIntent(goBackId, context, GroupingStudentActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_CLIENT_ID, clientId);
        intent.putExtra(IntentFlag.INTENT_FLAG_CLASS_NAME, className);
        intent.putExtra(IntentFlag.INTENT_FLAG_CLASS_ID, classId);
        intent.putExtra(IntentFlag.INTENT_FLAG_SCHOOL_NAME, schoolName);
        intent.putExtra(IntentFlag.INTENT_FLAG_GRADE_ID, gradeId);
        intent.putExtra(INTENT_FLAG_SOURCE, true);
        context.startActivity(intent);
    }

    /**
     * 跳转至收藏书籍页面
     *
     * @param stuCount    学生人数
     * @param vipCount    vip人数
     * @param schoolName  学校名
     * @param className   班级名
     * @param gradeId     年级id
     * @param classId     班级id
     * @param requestCode 跳转码
     * @param mActivity
     */
    public static void jumpToUpeClassName(int stuCount, int vipCount, String schoolName, String className, int gradeId, int classId, int requestCode, Activity mActivity) {
        Intent intent = getBaseIntent(R.string.go_back, mActivity, UpdateClassNameActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_STU_COUNT, stuCount);
        intent.putExtra(IntentFlag.INTENT_FLAG_VIP_COUNT, vipCount);
        intent.putExtra(IntentFlag.INTENT_FLAG_SCHOOL_NAME, schoolName);
        intent.putExtra(IntentFlag.INTENT_FLAG_CLASS_NAME, className);
        intent.putExtra(IntentFlag.INTENT_FLAG_GRADE_ID, gradeId);
        intent.putExtra(IntentFlag.INTENT_FLAG_CLASS_ID, classId);
        mActivity.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转至收藏书籍页面
     *
     * @param activity
     * @param go_back
     */
    public static void jumpToFavoritesListActivity(Activity activity, String tag, int go_back) {
        Intent intent = getBaseIntent(go_back, activity, FavoritesListActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_TAG, tag);
        intent.putExtra(INTENT_FLAG_SOURCE, true);
        activity.startActivity(intent);
    }
}
